package mortal.game.net.broadCast
{
	import Framework.MQ.*;
	import com.gengine.core.call.*;
	
	public class BroadCastManager extends Object
	{
		private var _caller:Caller;
		private static var _instance:BroadCastManager;
		
		public function BroadCastManager()
		{
			this._caller = new Caller();
			if (_instance != null)
			{
				throw new Error("BroadCastManager 单例");
			}
			
		}
		
		public function call(target:Object, messageblock:MessageBlock) : void
		{
			this._caller.call(target, messageblock);
			
		}
		
		public function registerCall(broadcastcall:BroadCastCall) : void
		{
			this._caller.addCall(broadcastcall.type, broadcastcall.call);
			
		}
		
		public function removeCall(broadcastcall:BroadCastCall) : void
		{
			this._caller.removeCall(broadcastcall.type, broadcastcall.call);
			
		}
		
		public static function get instance() : BroadCastManager
		{
			if (_instance == null)
			{
				_instance = new BroadCastManager;
			}
			return _instance;
		}
		
	}
}